<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>redis安装与配置-Linux | liang</title><meta name="keywords" content="Redis"><meta name="author" content="Liang"><meta name="copyright" content="Liang"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="redis安装包下载进入redis官方网站https:&#x2F;&#x2F;redis.io&#x2F;，下载Linux安装包  准备工作安装C语言编译环境 yum install centos-release-scl scl-utils-buildyum install -y devtoolset-8-toolchain  测试gcc版本 gcc --version  redis安装 下载redis-6.2.6.tar.g">
<meta property="og:type" content="article">
<meta property="og:title" content="redis安装与配置-Linux">
<meta property="og:url" content="http://liangzw.cn/2022/03/13/redis%E5%AE%89%E8%A3%85/index.html">
<meta property="og:site_name" content="liang">
<meta property="og:description" content="redis安装包下载进入redis官方网站https:&#x2F;&#x2F;redis.io&#x2F;，下载Linux安装包  准备工作安装C语言编译环境 yum install centos-release-scl scl-utils-buildyum install -y devtoolset-8-toolchain  测试gcc版本 gcc --version  redis安装 下载redis-6.2.6.tar.g">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://liangzw.cn/img/redis.png">
<meta property="article:published_time" content="2022-03-13T02:56:07.000Z">
<meta property="article:modified_time" content="2022-03-13T03:02:02.290Z">
<meta property="article:author" content="Liang">
<meta property="article:tag" content="Redis">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://liangzw.cn/img/redis.png"><link rel="shortcut icon" href="/img/avatar.png"><link rel="canonical" href="http://liangzw.cn/2022/03/13/redis%E5%AE%89%E8%A3%85/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'redis安装与配置-Linux',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2022-03-13 11:02:02'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><link rel="stylesheet" href="/css/iconfont.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/HCLonely/images@master/others/heartbeat.min.css"><!-- hexo injector head_end start --><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Zfour/hexo-electric-clock@1.0.6/clock.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Zfour/Butterfly-double-row-display@1.00/cardlistpost.min.css"/>
<style>#recent-posts > .recent-post-item >.recent-post-info > .article-meta-wrap > .tags:before {content:"\A";
  white-space: pre;}#recent-posts > .recent-post-item >.recent-post-info > .article-meta-wrap > .tags > .article-meta__separator{display:none}</style>
<!-- hexo injector head_end end --><meta name="generator" content="Hexo 5.4.1"><link rel="alternate" href="/atom.xml" title="liang" type="application/atom+xml">
</head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="wizard-scene"><div class="wizard-objects"><div class="wizard-square"></div><div class="wizard-circle"></div><div class="wizard-triangle"></div></div><div class="wizard"><div class="wizard-body"></div><div class="wizard-right-arm"><div class="wizard-right-hand"></div></div><div class="wizard-left-arm"><div class="wizard-left-hand"></div></div><div class="wizard-head"><div class="wizard-beard"></div><div class="wizard-face"><div class="wizard-adds"></div></div><div class="wizard-hat"><div class="wizard-hat-of-the-hat"></div><div class="wizard-four-point-star --first"></div><div class="wizard-four-point-star --second"></div><div class="wizard-four-point-star --third"></div></div></div></div></div></div><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/avatar.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data is-center"><div class="data-item"><a href="/archives/"><div class="headline">文章</div><div class="length-num">6</div></a></div><div class="data-item"><a href="/tags/"><div class="headline">标签</div><div class="length-num">5</div></a></div><div class="data-item"><a href="/categories/"><div class="headline">分类</div><div class="length-num">8</div></a></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 媒体</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于我</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="not-top-img" id="page-header"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">liang</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 媒体</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于我</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav></header><main class="layout" id="content-inner"><div id="post"><div id="post-info"><h1 class="post-title">redis安装与配置-Linux</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-03-13T02:56:07.000Z" title="发表于 2022-03-13 10:56:07">2022-03-13</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-03-13T03:02:02.290Z" title="更新于 2022-03-13 11:02:02">2022-03-13</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/Linux/">Linux</a><i class="fas fa-angle-right post-meta-separator"></i><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/Linux/Redis/">Redis</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="redis安装与配置-Linux"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div><article class="post-content" id="article-container"><h1 id="redis安装包下载"><a href="#redis安装包下载" class="headerlink" title="redis安装包下载"></a>redis安装包下载</h1><p>进入redis官方网站<a target="_blank" rel="noopener" href="https://redis.io/%EF%BC%8C%E4%B8%8B%E8%BD%BDLinux%E5%AE%89%E8%A3%85%E5%8C%85">https://redis.io/，下载Linux安装包</a></p>
<p><img src="https://gitee.com/itkaoyan/picgo/raw/master/img/image-20220305095910148.png"></p>
<h1 id="准备工作"><a href="#准备工作" class="headerlink" title="准备工作"></a>准备工作</h1><p>安装C语言编译环境</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">yum install centos-release-scl scl-utils-build</span><br><span class="line">yum install -y devtoolset-8-toolchain</span><br></pre></td></tr></table></figure>

<p>测试gcc版本</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">gcc --version</span><br></pre></td></tr></table></figure>

<h1 id="redis安装"><a href="#redis安装" class="headerlink" title="redis安装"></a>redis安装</h1><ol>
<li><p>下载<code>redis-6.2.6.tar.gz</code>放<code>/opt</code>目录</p>
</li>
<li><p>解压命令<code>tar -zxvf redis-6.2.6.tar.gz</code></p>
</li>
<li><p>解压完成后进入目录：<code>cd redis-6.2.6</code></p>
</li>
<li><p>编译并安装<code>make &amp;&amp; make install</code></p>
</li>
<li><p>进入安装目录<code>cd /usr/local/bin</code></p>
<p>查看默认安装目录：<br><code>redis-benchmark</code>:性能测试工具，可以在自己本子运行，看看自己本子性能如何<br><code>redis-check-aof</code>：修复有问题的AOF文件，rdb和aof后面讲<br><code>redis-check-dump</code>：修复有问题的dump.rdb文件<br><code>redis-sentinel</code>：Redis集群使用<br><code>redis-server</code>：Redis服务器启动命令<br><code>redis-cli</code>：客户端，操作入口</p>
</li>
</ol>
<p><img src="https://gitee.com/itkaoyan/picgo/raw/master/img/image-20220305101233569.png"></p>
<h1 id="前台启动（不推荐）"><a href="#前台启动（不推荐）" class="headerlink" title="前台启动（不推荐）"></a>前台启动（不推荐）</h1><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">redis-server</span><br></pre></td></tr></table></figure>

<p><img src="https://gitee.com/itkaoyan/picgo/raw/master/img/image-20220305101522603.png"></p>
<h1 id="后台启动（推荐）"><a href="#后台启动（推荐）" class="headerlink" title="后台启动（推荐）"></a>后台启动（推荐）</h1><h2 id="备份redis-conf"><a href="#备份redis-conf" class="headerlink" title="备份redis.conf"></a>备份redis.conf</h2><p>​    拷贝一份redis.conf到其他目录</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">cp /opt/redis-6.2.6/redis.conf /etc/redis.conf</span><br></pre></td></tr></table></figure>

<h2 id="后台启动设置daemonize-no改成yes"><a href="#后台启动设置daemonize-no改成yes" class="headerlink" title="后台启动设置daemonize no改成yes"></a>后台启动设置daemonize no改成yes</h2><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">vim /etc/redis.conf</span><br></pre></td></tr></table></figure>

<p><img src="https://gitee.com/itkaoyan/picgo/raw/master/img/image-20220305102216282.png"></p>
<h2 id="redis启动"><a href="#redis启动" class="headerlink" title="redis启动"></a>redis启动</h2><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">redis-server /etc/redis.conf</span><br></pre></td></tr></table></figure>

<h2 id="查看redis是否启动"><a href="#查看redis是否启动" class="headerlink" title="查看redis是否启动"></a>查看redis是否启动</h2><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">ps -ef | grep redis</span><br></pre></td></tr></table></figure>

<p><img src="https://gitee.com/itkaoyan/picgo/raw/master/img/image-20220305101333095.png"></p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">Liang</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="http://liangzw.cn/2022/03/13/redis%E5%AE%89%E8%A3%85/">http://liangzw.cn/2022/03/13/redis安装/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="http://liangzw.cn" target="_blank">liang</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/Redis/">Redis</a></div><div class="post_share"><div class="social-share" data-image="/img/redis.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2022/03/13/%E5%8D%95%E5%90%91%E9%98%9F%E5%88%97-%E7%8E%AF%E5%BD%A2%E9%98%9F%E5%88%97/"><img class="prev-cover" src="/img/algorithm.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">环形队列-银行排队案例</div></div></a></div><div class="next-post pull-right"><a href="/2022/03/13/Hexo%E6%90%AD%E5%BB%BA%E5%87%86%E5%A4%87/"><img class="next-cover" src="/img/hexo.png" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">Hexo博客butterfly主题 搭建准备</div></div></a></div></nav><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div class="vcomment" id="vcomment"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/img/avatar.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">Liang</div><div class="author-info__description"></div></div><div class="card-info-data is-center"><div class="card-info-data-item"><a href="/archives/"><div class="headline">文章</div><div class="length-num">6</div></a></div><div class="card-info-data-item"><a href="/tags/"><div class="headline">标签</div><div class="length-num">5</div></a></div><div class="card-info-data-item"><a href="/categories/"><div class="headline">分类</div><div class="length-num">8</div></a></div></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/AngelFloating"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/AngelFloating" target="_blank" title="Github"><i class="iconfont icon-GitHub card_icon"></i></a><a class="social-icon" href="https://gitee.com/itkaoyan" target="_blank" title="Gitee"><i class="iconfont icon-gitee card_icon"></i></a><a class="social-icon" href="https://blog.csdn.net/Angel_QAQ" target="_blank" title="CSDN"><i class="iconfont icon-csdn card_icon"></i></a><a class="social-icon" href="https://space.bilibili.com/386781673" target="_blank" title="bilibili"><i class="iconfont icon-bilibili card_icon"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">萌新一枚^……^ 本博客用于记录日常学习，欢迎大家留言！！！</div><div class="xpand" style="height:200px; text-align: center;"><canvas class="illo" width="800" height="800" style="max-width: 200px; max-height: 200px; touch-action: none; width: 640px; height: 640px;"></canvas><canvas display="block" margin="0 auto" cursor="move"></canvas><script src="https://cdn.jsdelivr.net/gh/xiaopengand/blogCdn@latest/xzxr/twopeople1.js"></script><script src="https://cdn.jsdelivr.net/gh/xiaopengand/blogCdn@latest/xzxr/zdog.dist.js"></script><script id="rendered-js" src="https://cdn.jsdelivr.net/gh/xiaopengand/blogCdn@latest/xzxr/twopeople.js"></script><style></style></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#redis%E5%AE%89%E8%A3%85%E5%8C%85%E4%B8%8B%E8%BD%BD"><span class="toc-number">1.</span> <span class="toc-text">redis安装包下载</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%87%86%E5%A4%87%E5%B7%A5%E4%BD%9C"><span class="toc-number">2.</span> <span class="toc-text">准备工作</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#redis%E5%AE%89%E8%A3%85"><span class="toc-number">3.</span> <span class="toc-text">redis安装</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%89%8D%E5%8F%B0%E5%90%AF%E5%8A%A8%EF%BC%88%E4%B8%8D%E6%8E%A8%E8%8D%90%EF%BC%89"><span class="toc-number">4.</span> <span class="toc-text">前台启动（不推荐）</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%90%8E%E5%8F%B0%E5%90%AF%E5%8A%A8%EF%BC%88%E6%8E%A8%E8%8D%90%EF%BC%89"><span class="toc-number">5.</span> <span class="toc-text">后台启动（推荐）</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%A4%87%E4%BB%BDredis-conf"><span class="toc-number">5.1.</span> <span class="toc-text">备份redis.conf</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%90%8E%E5%8F%B0%E5%90%AF%E5%8A%A8%E8%AE%BE%E7%BD%AEdaemonize-no%E6%94%B9%E6%88%90yes"><span class="toc-number">5.2.</span> <span class="toc-text">后台启动设置daemonize no改成yes</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#redis%E5%90%AF%E5%8A%A8"><span class="toc-number">5.3.</span> <span class="toc-text">redis启动</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%9F%A5%E7%9C%8Bredis%E6%98%AF%E5%90%A6%E5%90%AF%E5%8A%A8"><span class="toc-number">5.4.</span> <span class="toc-text">查看redis是否启动</span></a></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2022/03/18/%E5%92%8Cequals-%E5%8C%BA%E5%88%AB/" title="==和equals()区别"><img src="/img/javase.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="==和equals()区别"/></a><div class="content"><a class="title" href="/2022/03/18/%E5%92%8Cequals-%E5%8C%BA%E5%88%AB/" title="==和equals()区别">==和equals()区别</a><time datetime="2022-03-18T08:03:32.000Z" title="发表于 2022-03-18 16:03:32">2022-03-18</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/03/13/nginx%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86/" title="Nginx反向代理、Https配置 教程"><img src="/img/nginx.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Nginx反向代理、Https配置 教程"/></a><div class="content"><a class="title" href="/2022/03/13/nginx%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86/" title="Nginx反向代理、Https配置 教程">Nginx反向代理、Https配置 教程</a><time datetime="2022-03-13T10:15:57.000Z" title="发表于 2022-03-13 18:15:57">2022-03-13</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/03/13/%E5%8D%95%E5%90%91%E9%98%9F%E5%88%97-%E7%8E%AF%E5%BD%A2%E9%98%9F%E5%88%97/" title="环形队列-银行排队案例"><img src="/img/algorithm.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="环形队列-银行排队案例"/></a><div class="content"><a class="title" href="/2022/03/13/%E5%8D%95%E5%90%91%E9%98%9F%E5%88%97-%E7%8E%AF%E5%BD%A2%E9%98%9F%E5%88%97/" title="环形队列-银行排队案例">环形队列-银行排队案例</a><time datetime="2022-03-13T02:58:50.000Z" title="发表于 2022-03-13 10:58:50">2022-03-13</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/03/13/redis%E5%AE%89%E8%A3%85/" title="redis安装与配置-Linux"><img src="/img/redis.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="redis安装与配置-Linux"/></a><div class="content"><a class="title" href="/2022/03/13/redis%E5%AE%89%E8%A3%85/" title="redis安装与配置-Linux">redis安装与配置-Linux</a><time datetime="2022-03-13T02:56:07.000Z" title="发表于 2022-03-13 10:56:07">2022-03-13</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/03/13/Hexo%E6%90%AD%E5%BB%BA%E5%87%86%E5%A4%87/" title="Hexo博客butterfly主题 搭建准备"><img src="/img/hexo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Hexo博客butterfly主题 搭建准备"/></a><div class="content"><a class="title" href="/2022/03/13/Hexo%E6%90%AD%E5%BB%BA%E5%87%86%E5%A4%87/" title="Hexo博客butterfly主题 搭建准备">Hexo博客butterfly主题 搭建准备</a><time datetime="2022-03-13T02:54:07.000Z" title="发表于 2022-03-13 10:54:07">2022-03-13</time></div></div></div></div></div></div></main><footer id="footer" style="background: transparent"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2022  <i id="heartbeat" class="fa fas fa-heartbeat"></i> Liang</div><div class="framework-info"><span class="footer-separator"> </span><a target="_blank" rel="noopener" href="https://hexo.io"><img class="entered loading" src="https://img.shields.io/badge/Frame-Hexo-blue?style=plastic&amp;logo=hexo" title="博客框架为Hexo" alt="hexo" data-ll-status="loading"/></a><span class="footer-separator"> </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly"><img class="entered loading" src="https://img.shields.io/badge/Theme-Butterfly-6513df?style=plastic&amp;amp&amp;logo=bitdefender" title="主题采用butterfly" alt="主题采用butterfly" data-ll-status="loading"/></a><span class="footer-separator"></span><a target="_blank" rel="noopener" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"> <img class="entered loading" src="https://img.shields.io/badge/Copyright-BY--NC--SA%204.0-d42328?style=plastic&amp;amp&amp;logo=Claris" title="本站采用知识共享署名-非商业性使用-相同方式共享4.0国际许可协议进行许可" alt="协议" data-ll-status="loading"/></a></div><div class="icp"><a target="_blank" rel="noopener" href="https://beian.miit.gov.cn"><img class="icp-icon" src="/img/beian.png"/><span>豫ICP备2022004682号</span></a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">本地搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script><script src="/js/search/local-search.js"></script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',()=> {preloader.endLoading()})
setTimeout(function(){preloader.endLoading();}, 2000);</script><div class="js-pjax"><script>function loadValine () {
  function initValine () {
    const valine = new Valine(Object.assign({
      el: '#vcomment',
      appId: 'nYciDAhKnPEgUmkugfrWeaTF-gzGzoHsz',
      appKey: 'DfhGAnYf6fau55RD8MepHeiX',
      avatar: 'monsterid',
      serverURLs: '',
      emojiMaps: "",
      path: window.location.pathname,
      visitor: false
    }, null))
  }

  if (typeof Valine === 'function') initValine() 
  else getScript('https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js').then(initValine)
}

if ('Valine' === 'Valine' || !false) {
  if (false) btf.loadComment(document.getElementById('vcomment'),loadValine)
  else setTimeout(loadValine, 0)
} else {
  function loadOtherComment () {
    loadValine()
  }
}</script></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><!-- hexo injector body_end start -->
  <script data-pjax src="https://cdn.jsdelivr.net/gh/AngelFloating/hexo-github-calendar@master/hexo_githubcalendar.js"></script>
  <script data-pjax>
        function GithubCalendarConfig(){
            var git_githubapiurl ="https://python-github-calendar-api.vercel.app/api?AngelFloating";
            var git_color =['#ebedf0', '#fdcdec', '#fc9bd9', '#fa6ac5', '#f838b2', '#f5089f', '#c4067e', '#92055e', '#540336', '#48022f', '#30021f'];
            var git_user ="AngelFloating";
            var parent_div_git = document.getElementById('recent-posts');
            var git_div_html = '<div class="recent-post-item" style="width:100%;height:auto;padding:10px;"><div id="github_loading" style="width:10%;height:100%;margin:0 auto;display: block"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  viewBox="0 0 50 50" style="enable-background:new 0 0 50 50" xml:space="preserve"><path fill="#d0d0d0" d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z" transform="rotate(275.098 25 25)"><animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite"></animateTransform></path></svg></div><div id="github_container"></div></div>';
            if(parent_div_git && location.pathname =='/'){
                console.log('已挂载github calendar')
                // parent_div_git.innerHTML=git_div_html+parent_div_git.innerHTML // 无报错，但不影响使用(支持pjax跳转)
                parent_div_git.insertAdjacentHTML("afterbegin",git_div_html) // 有报错，但不影响使用(支持pjax跳转)
            };
            GithubCalendar(git_githubapiurl,git_color,git_user)
        }
        if(document.getElementById('recent-posts')){
            GithubCalendarConfig()
        }
    </script>
    <style>#github_container{min-height:280px}@media screen and (max-width:650px) {#github_container{background-image:;min-height:0px}}</style>
    <style></style><script data-pjax>function electric_clock_injector_config(){
                var parent_div_git = document.getElementsByClassName('sticky_layout')[0];
                var item_html = '<div class="card-widget card-clock"><div class="card-glass"><div class="card-background"><div class="card-content"><div id="hexo_electric_clock"><img id="card-clock-loading" src="https://cdn.jsdelivr.net/gh/Zfour/Butterfly-clock/clock/images/weather/loading.gif" style="height: 120px; width: 100%;" data-ll-status="loading" class="entered loading"></div></div></div></div></div>';
                console.log('已挂载electric_clock')
                // parent_div_git.innerHTML=item_html+parent_div_git.innerHTML // 无报错，但不影响使用(支持pjax跳转)
                parent_div_git.insertAdjacentHTML("afterbegin",item_html) // 有报错，但不影响使用(支持pjax跳转)
            }if( document.getElementsByClassName('sticky_layout')[0] && (location.pathname ==='all'|| 'all' ==='all')){

            electric_clock_injector_config()
        } </script><script src="https://pv.sohu.com/cityjson?ie=utf-8"></script><script data-pjax  src="https://cdn.jsdelivr.net/gh/Zfour/hexo-electric-clock@1.0.6/clock.js"></script><!-- hexo injector body_end end --></body></html>